package com.itheima;

//定义dog类
public class Dog {
    //定义dog的四个属性字符串
    String color = new String();
    String breed = new String();
    String eat = new String();
    String lookhome = new String();

    //定义初始化set方法
    public void set() {
        color = null;
        breed = null;
        eat = null;
        lookhome = null;
    }

    //定义dog的初始化set方法
    public void set(String col, String bre, String act, int option) {
        //形参值赋给dog的各个属性
        color = col;
        breed = bre;
        //针对option选项确定是在吃东西还是看家
        if (option == 1) {
            eat = act;
        } else if (option == 2) {
            lookhome = act;
        } else {
            System.out.println("狗无此功能");
            return;
        }
    }

    //定义dog的属性获取方法get
    public void get(int option) {
        //针对option选项确定是在吃东西还是看家
        if (option == 1) {
            System.out.println(color + breed + "正在" + eat);
        } else if (option == 2) {
            System.out.println(color + breed + "正在" + lookhome);
        } else {
            System.out.println("功能选项错误");
            return;
        }
    }
}
